/**
 * Copyright (c) 2014, 2017, Oracle and/or its affiliates.
 * The Universal Permissive License (UPL), Version 1.0
 */
"use strict";
define(["ojs/ojcore","jquery","ojs/ojcomponentcore","ojs/ojdomscroller","ojs/ojanimation","promise"],function(a,g){a.Td=function(a,c,d){this.ba=c;this.A=a;this.rd=!1;this.Sja(d);this.Init()};a.b.sa(a.Td,a.b,"oj.DataSourceContentHandler");a.Td.prototype.Init=function(){a.Td.u.Init.call(this)};a.b.g("DataSourceContentHandler.prototype.Init",{Init:a.Td.prototype.Init});a.Td.prototype.Cx=function(){};a.Td.prototype.XA=function(){};a.Td.prototype.bh=function(){g(this.ba).empty();this.ba=this.A=null};a.Td.prototype.Ex=
function(){return!this.rd};a.Td.prototype.A_=function(){this.Yp()?this.ba.setAttribute("role","tree"):this.ba.setAttribute("role","listbox")};a.Td.prototype.Y0=function(){this.Rb();this.tp(!1);this.A_();this.Mb()};a.Td.prototype.yg=function(a){return a.key};a.Td.prototype.Ue=function(a){var c,d,e;c=g(this.ba).find("."+this.A.Ug());for(d=0;d<c.length;d++)if(e=c[d],a==this.yg(e))return e;return null};a.Td.prototype.lga=function(){return this.Ta};a.Td.prototype.Sja=function(a){this.Ta=a};a.Td.prototype.tp=
function(){this.A.hB()};a.Td.prototype.QX=function(a,c,d,e,f){var h,k;h=document.createElement("li");g(h).uniqueId();k=g(a).children("."+this.A.Ug()+", .oj-listview-no-data-message");a.insertBefore(h,c===k.length?null:k[c]);k=g(a).children().index(h);this.W3(h,k,a,c,d,e,f)};a.Td.prototype.bLa=function(a,c,d,e,f){var h,k;this.Rb();g(a).empty();h=a.parentNode;k=g(h).children().index(a);this.W3(a,k,h,c,d,e,f)};a.Td.prototype.W3=function(a,c,d,e,f,h,k){var l;void 0==k&&(k=this.Aw.bind(this));e=this.jY(e,
f,h,a);h=this.A.fva();null!=h?(h=h.call(this,e),null!=h&&(null===h.parentNode||h.parentNode instanceof DocumentFragment?a.appendChild(h):null==h.parentNode&&h.toString&&(l=document.createElement("span"),l.appendChild(document.createTextNode(h.toString())),a.appendChild(l)))):(l=document.createElement("span"),l.appendChild(document.createTextNode(null==f?"":f.toString())),a.appendChild(l));a=d.children[c];e.parentElement=a;g.data(a,"data",f);k(a,e)};a.Td.prototype.Aw=function(a,c){var d;a.key=c.key;
a=g(a);a.uniqueId();d=this.A.TM(a);d.attr("role",this.Yp()?"treeitem":"option");d!=a&&a.attr("role","presentation");d.addClass(this.A.vp());this.EA(c)||a.addClass("oj-skipfocus");a.addClass(this.A.Ug())};a.Td.prototype.jY=function(a,c,d,e){var f,g;f={};f.parentElement=e;f.index=a;f.data=c;f.component=this.A.Yc();f.datasource=this.Ta;for(g in d)d.hasOwnProperty(g)&&(f[g]=d[g]);return f};a.Td.prototype.EA=function(a){return this.A.qD("focusable",a,!0)};a.Td.prototype.pN=function(a){return this.A.qD("selectable",
a,!0)};a.Td.prototype.Rb=function(){this.A&&this.A.Rb()};a.Td.prototype.Mb=function(){this.A&&this.A.Mb()};a.Xb=function(b,c,d){a.Xb.u.constructor.call(this,b,c,d)};a.b.sa(a.Xb,a.Td,"oj.TableDataSourceContentHandler");a.Xb.prototype.Init=function(){a.Xb.u.Init.call(this)};a.Xb.prototype.Yp=function(){return!1};a.Xb.prototype.bh=function(){a.Xb.u.bh.call(this);this.BE();null!=this.KA&&(this.KA.destroy(),this.OZ=this.KA=null);this.$F=null};a.Xb.prototype.Cx=function(a,c){this.ci()&&void 0!=this.Qt&&
this.Qt!=c&&(this.Qt=c,this.checkViewport())};a.Xb.prototype.XA=function(){this.ci()&&this.checkViewport()};a.Xb.prototype.ci=function(){return"loadMoreOnScroll"==this.A.options.scrollPolicy?!0:!1};a.Xb.prototype.Go=function(){return Math.max(0,this.A.options.scrollPolicyOptions.fetchSize)};a.Xb.prototype.Lo=function(){var b=this.A.options.scrollPolicyOptions.scroller;return null!=b&&g.contains(b,this.ba)?(this.pv=a.pf.DGa(b,this.ba),b):this.A.hk()};a.Xb.prototype.CT=function(){return this.A.options.scrollPolicyOptions.maxCount};
a.Xb.prototype.Sja=function(b){var c;this.BE();if(null!=b){this.ci()&&(c=this,this.OZ=function(a){null!=a?(c.Rb(),c.jW(),c.Ex()&&c.Rb(),c.xU(a),a.maxCountLimit?c.DU():c.o4(),c.Mb(),c.Mb()):void 0===a&&(c.jW(),c.Mb())},this.KA=new a.pf(this.Lo(),b,{fetchSize:this.Go(),fetchTrigger:this.pv,maxCount:this.CT(),success:this.OZ,error:this.Mb}),this.KA.EU=function(b,e){1>=e-b&&c.Rb();a.pf.prototype.EU.call(this,b,e)});this.sia=this.fJa.bind(this);this.ria=this.eJa.bind(this);this.nia=this.aJa.bind(this);
this.qia=this.cJa.bind(this);this.oia=this.bJa.bind(this);this.EN=this.dJa.bind(this);if(a.Ba&&b instanceof a.Ba)b.on("sync",this.sia);b.on("sort",this.ria);b.on("add",this.nia);b.on("remove",this.qia);b.on("change",this.oia);b.on("reset",this.EN);b.on("refresh",this.EN)}this.Ta=b};a.Xb.prototype.o4=function(){var a,c;null==this.$F&&(a=g(document.createElement("li")),a.uniqueId().attr("role","presentation").addClass(this.A.gj()),c=g(document.createElement("div")),c.addClass("oj-listview-loading-icon"),
a.append(c),g(this.ba).append(a),this.$F=a)};a.Xb.prototype.jW=function(){null!=this.$F&&this.$F.remove();this.$F=null};a.Xb.prototype.Aw=function(b,c){var d;a.Xb.u.Aw.call(this,b,c);g(b).addClass(this.A.gj());this.A.yc()&&this.pN(c)&&this.A.mg(g(b)).attr("aria-selected",!1);this.ci()&&(d=Math.min(this.Ta.totalSize(),this.CT()),-1===d&&(d=this.CT()),0<d&&g(b).attr("aria-setsize",d).attr("aria-posinset",c.index+1));this.A.Qw(b,c)};a.Xb.prototype.cGa=function(b,c){var d,e;this.Rb();this.Aw(b,c);d=g(b);
d.outerHeight();e=this.A.gj();d.children().wrapAll("\x3cdiv\x3e\x3c/div\x3e");d.removeClass(e).addClass("oj-listview-item-add-remove-transition");d.children().first().addClass(e);this.Rb();d=this.A.Hw("add");var f=this;a.$.ym(b,"add",d).then(function(){f.kwa(c,b)});this.Mb()};a.Xb.prototype.DU=function(){a.t.error("max count reached")};a.Xb.prototype.BE=function(){null!=this.Ta&&(this.Ta.off("sync",this.sia),this.Ta.off("sort",this.ria),this.Ta.off("add",this.nia),this.Ta.off("remove",this.qia),this.Ta.off("change",
this.oia),this.Ta.off("reset",this.EN),this.Ta.off("refresh",this.EN))};a.Xb.prototype.yEa=function(a){return this.ci()&&null!=a&&a.keys&&0<a.keys.length&&(-1==this.Ta.totalSize()||this.Ta.totalSize()>a.keys.length)};a.Xb.prototype.tp=function(b){var c=!0,d;this.Rb();if(this.Ex()&&(this.rd=!0,a.Xb.u.tp.call(this,b),a.Ba&&this.Ta instanceof a.Ba&&(c=!1,this.Rb()),c||b)){c&&this.Rb();b={fetchType:"init",startIndex:0};this.ci()&&(b.pageSize=this.Go());d=this;b=this.Ta.fetch(b);b.then(function(a){null!=
d.A&&c&&(g(d.ba).empty(),d.xU(a),d.yEa(a)&&(d.o4(),d.A.uO()))},function(a){d.Fq(a);d.Mb()});this.Mb();return}this.Mb()};a.Xb.prototype.Fq=function(b){a.t.error(b);this.ci()&&this.jW();this.A.eu()};a.Xb.prototype.Qs=function(a,c){var d,e,f;d=this.ba.childElementCount;for(e=0;e<a.length;e++)f=a[e],this.QX(this.ba,d,f,this.getMetadata(d,c[e],f)),d+=1};a.Xb.prototype.aJa=function(a){var c,d,e;if(null!=this.ba){this.Rb();c=a.data;d=a.keys;a=a.indexes;if(null!=c&&null!=d&&0<d.length&&0<c.length&&d.length==
c.length&&null!=a&&d.length==a.length){for(e=0;e<c.length;e++)this.Rb(),this.QX(this.ba,a[e],c[e],this.getMetadata(a[e],d[e],c[e]),this.cGa.bind(this)),this.Mb();this.Ex()&&this.Rb();this.Ofa()}this.Mb()}};a.Xb.prototype.kwa=function(a,c){g(c).removeClass("oj-listview-item-add-remove-transition").addClass(this.A.gj()).children().children().unwrap();this.A.Yha(c,a);this.Mb()};a.Xb.prototype.cJa=function(a){var c,d;a=a.keys;if(null!=this.ba&&null!=a&&0!=a.length){this.Rb();for(c=0;c<a.length;c++)d=
this.Ue(a[c]),null!=d&&(this.Rb(),this.wCa(d),this.Mb());this.A.wx();this.Mb()}};a.Xb.prototype.wCa=function(b){var c,d=this,e;this.Rb();c=this.A.gj();b=g(b);b.children().wrapAll("\x3cdiv class\x3d'"+c+"'\x3e\x3c/div\x3e");b.removeClass(c).addClass("oj-listview-item-add-remove-transition");this.Rb();c=this.A.Hw("remove");e=b.get(0);a.$.ym(e,"remove",c).then(function(){d.Uxa(b)});this.Mb()};a.Xb.prototype.Uxa=function(a){a=g(a);var c=a.parent();this.A.zZ(a.get(0));a.remove();0==c.get(0).childElementCount&&
this.A.eu();this.Mb()};a.Xb.prototype.bJa=function(a){var c,d,e,f;c=a.keys;if(null!=this.ba&&null!=c&&0!=c.length){this.Rb();d=a.data;a=a.indexes;for(e=0;e<c.length;e++)f=this.Ue(c[e]),null!=f&&(this.Rb(),this.bLa(f,a[e],d[e],this.getMetadata(a[e],c[e],d[e]),this.bGa.bind(this)),this.Mb());this.A.wx();this.Mb()}};a.Xb.prototype.bGa=function(b,c){var d=this,e;this.Rb();this.Aw(b,c);e=this.A.Hw("update");a.$.ym(b,"update",e).then(function(){d.Vxa(b)});this.Mb()};a.Xb.prototype.Vxa=function(a){g(a).removeClass("oj-listview-item-add-remove-transition");
this.A.jLa();this.Mb()};a.Xb.prototype.dJa=function(){null!=this.ba&&(this.Rb(),this.A.wx(),this.tp(!0),this.Mb())};a.Xb.prototype.xU=function(a){var c;null!=this.ba&&(c=a.data,a=a.keys,Array.isArray(c)&&Array.isArray(a)&&c.length==a.length&&(this.Qs(c,a),this.Ofa()))};a.Xb.prototype.fJa=function(a){null!=this.ba&&(this.Rb(),0===a.startIndex&&g(this.ba).empty(),this.A.wx(),this.xU(a),this.Mb())};a.Xb.prototype.eJa=function(){null!=this.ba&&(this.Rb(),this.A.wx(),this.A.tn()&&this.A.Nk(!0),this.tp(!0),
this.Mb())};a.Xb.prototype.Ofa=function(){this.rd=!1;this.A.eu();this.checkViewport();this.Mb()};a.Xb.prototype.checkViewport=function(){var a=this,c;this.Rb();null!=this.KA&&0<this.Ta.totalSize()&&this.Ex()&&(c=this.KA.checkViewport(),null!=c&&(this.Rb(),c.then(function(c){a.OZ(c);a.Mb()},null)));this.Mb()};a.Xb.prototype.getMetadata=function(a,c,d){d=d.context;null==d&&(d={});null==d.index&&(d.index=a);null==d.key&&(d.key=c);return d};a.Pi=function(b,c,d){a.Pi.u.constructor.call(this,b,c,d)};a.b.sa(a.Pi,
a.Td,"oj.TreeDataSourceContentHandler");a.Pi.prototype.Init=function(){a.Pi.u.Init.call(this)};a.Pi.prototype.Yp=function(){return!0};a.Pi.prototype.tp=function(b){this.Rb();a.Pi.u.tp.call(this,b);this.fetchChildren(0,null,this.ba,null);this.Mb()};a.Pi.prototype.fetchChildren=function(a,c,d,e){this.Rb();this.rd=!0;a={start:a,count:this.Ta.getChildCount(c)};this.Ta.fetchChildren(c,a,{success:function(a){this.Qs(a,c,d,e)}.bind(this),error:function(a){this.Fq(a)}.bind(this)});this.Mb()};a.Pi.prototype.Qs=
function(a,c,d,e){var f,g,k,l;this.Rb();c=a.getStart();f=a.getCount();for(g=0;g<f;g++)k=a.getData(c+g),l=a.getMetadata(c+g),this.QX(d,c+g,k,l);this.rd=!1;null!=e&&e.call(null,d);this.A.eu();this.zi=!0;this.Mb()};a.Pi.prototype.Aw=function(b,c){var d,e,f,h,k,l;this.Rb();a.Pi.u.Aw.call(this,b,c);d=this.A.ti();e=this.A.gj();f=this.A.Sf();h=this.A.Iw();l=this.A.Hn();k=this.A.vp();b=g(b);!1==c.leaf?(b.children().wrapAll("\x3cdiv\x3e\x3c/div\x3e"),b.hasClass(k)?b.removeClass(k).children().first().addClass(k).attr("aria-expanded",
"false"):b.children().first().attr("role","presentation").find("."+k).attr("aria-expanded","false"),e=b.children().first(),e.uniqueId().addClass(f),this.A.DA()&&(b.addClass("oj-collapsed"),f=document.createElement("a"),g(f).attr("href","#").attr("aria-labelledby",e.get(0).id).addClass("oj-component-icon oj-clickable-icon-nocontext").addClass(l),e.prepend(f)),l=document.createElement("ul"),g(l).addClass(d).addClass(h).attr("role","group"),b.append(l)):!0==c.leaf&&b.addClass(e);this.A.yc()&&this.pN(c)&&
this.A.mg(b).attr("aria-selected",!1);this.A.Qw(b[0],c);this.Mb()};a.Pi.prototype.Fq=function(b){this.Rb();a.t.error(b);this.A.eu();this.Mb()};a.Pi.prototype.Ax=function(a,c){var d,e;this.Rb();d=this.yg(a[0]);e=a.children("ul")[0];this.fetchChildren(0,d,e,c);this.Mb()};a.Pi.prototype.xx=function(a){a.empty()};a.pe=function(a,c){this.A=a;this.ba=c};a.b.sa(a.pe,a.b,"oj.StaticContentHandler");a.pe.prototype.Init=function(){a.pe.u.Init.call(this)};a.pe.prototype.bh=function(){this.Kja(this.ba,0);this.bMa()};
a.pe.prototype.Ex=function(){return!0};a.pe.prototype.Cx=function(){};a.pe.prototype.XA=function(){};a.pe.prototype.Y0=function(){this.Ria(this.ba,0);this.A_();this.A.eu()};a.pe.prototype.Ax=function(a,c){var d;d="."+this.A.ti();d=g(a).children(d)[0];g(d).css("display","block");c.call(null,d)};a.pe.prototype.xx=function(){};a.pe.prototype.Yp=function(){null==this.TZ&&(this.TZ=0<g(this.ba).children("li").children("ul").length);return this.TZ};a.pe.prototype.Kja=function(a,c){var d,e,f,h,k,l,m,r,t,
s;d=this.A.ti();e=this.A.Iw();f=this.A.lA();h=this.A.Sf();k=this.A.gj();l=this.A.Ug();m=a.children;for(r=0;r<m.length;r++)t=m[r],this.aMa(t),t=g(t),t.removeClass(l).removeClass(k).removeClass(this.A.LY(c)).removeClass("oj-skipfocus").removeClass("oj-focus").removeClass("oj-hover").removeClass("oj-expanded").removeClass("oj-collapsed").removeClass("oj-selected"),s=t.children("ul"),0<s.length&&(t.children("."+h).children().unwrap(),t.children(".oj-component-icon").remove(),t=g(s[0]),t.removeClass(d).removeClass(f).removeClass(e).removeAttr("role"),
this.Kja(t[0],c+1))};a.pe.prototype.Ria=function(a,c){var d,e,f,h,k,l,m,r,t,s,q,p,n,u,v;d=this.A.gj();e=this.A.Ug();f=this.A.ti();h=this.A.Sf();k=this.A.Iw();l=this.A.Hn();m=this.A.vp();r=a.children;t=this.A.DA();for(s=0;s<r.length;s++)q=g(r[s]),p=this.jY(q),this.tLa(q),q.uniqueId().addClass(e),0<c&&q.addClass(this.A.LY(c)),this.EA(p)||q.addClass("oj-skipfocus"),n=q.children("ul"),0<n.length?(this.TZ=!0,q.children(":not(ul)").wrapAll("\x3cdiv\x3e\x3c/div\x3e"),u=q.children().first(),u.addClass(h),
this.uJa(n[0])&&(q.hasClass(m)?(q.removeClass(m),u.addClass(m).attr("aria-expanded","false")):(u.attr("role","presentation"),u.find("."+m).attr("aria-expanded","false")),t&&(q.addClass("oj-collapsed"),u.uniqueId(),v=document.createElement("a"),g(v).attr("href","#").attr("role","button").attr("aria-labelledby",u.get(0).id).addClass("oj-component-icon oj-clickable-icon-nocontext").addClass(l),u.prepend(v))),n=g(n[0]),n.addClass(f).addClass(k).attr("role","group").css("display","none"),this.Ria(n[0],
c+1)):q.addClass(d),this.A.yc()&&this.pN(p)&&this.A.mg(q).attr("aria-selected",!1),this.A.Qw(q[0],p)};a.pe.prototype.A_=function(){this.Yp()?this.ba.setAttribute("role","tree"):this.ba.setAttribute("role","listbox")};a.pe.prototype.bMa=function(){this.ba.removeAttribute("role")};a.pe.prototype.uJa=function(a){return 0<g(a).children("li").length};a.pe.prototype.jY=function(a){var c;c={};c.key=a.attr("id");c.parentElement=a.children().first()[0];c.index=a.index();c.data=a[0];c.component=this.A.Yc();
this.Yp()&&(c.leaf=0==a.children("ul").length,a=a.parents("li."+this.A.Ug()),c.depth=a.length,c.parentKey=0==a.length?null:a.first().attr("id"));return c};a.pe.prototype.tLa=function(a){var c=this.A.TM(a);c.attr("role",this.Yp()?"treeitem":"option");c!=a&&a.attr("role","presentation");c.addClass(this.A.vp())};a.pe.prototype.aMa=function(a){a=this.A.TM(g(a));a.removeAttr("role");a.removeAttr("aria-selected");a.removeAttr("aria-expanded");a.removeClass(this.A.vp())};a.pe.prototype.yg=function(a){return g(a).attr("id")};
a.pe.prototype.Ue=function(a){return document.getElementById(a)};a.pe.prototype.EA=function(a){return this.A.qD("focusable",a,!0)};a.pe.prototype.pN=function(a){return this.A.qD("selectable",a,!0)};a.JV=function(b,c){function d(){}a.b.sa(d,b,"");d.prototype=g.extend(d.prototype,c);return d}(Object,{Bg:37,kh:39,sl:40,Bl:38,cH:9,PO:13,RO:27,SO:113,sP:32,Lm:0,Km:1,$0:2,jMa:0,xu:1,pr:function(b){var c=this,d;this.du=[];this.Rb();this.V=b.V;this.element=b.element;this.oe=b.oe;this.options=b;this.element.uniqueId().addClass(this.$O()+
" oj-component-initnode");this.bH();"undefined"!=typeof a.Za&&(this.Xg=d=new a.Za(this),this.V._on(this.element,{dragstart:function(a){return d.sU(a)},dragenter:function(a){return d.pU(a)},dragover:function(a){return d.rU(a)},dragleave:function(a){return d.qU(a)},dragend:function(a){return d.oU(a)},drag:function(a){return d.Hwa(a)},drop:function(a){return d.tU(a)}}));this.V._on(this.element,{click:function(a){c.cP(a)},touchstart:function(a){c.RG(a)},touchend:function(a){c.vB(a)},touchcancel:function(a){c.vB(a)},
mousedown:function(a){0===a.button?c.uE()||c.RG(a):c.dG=!0},mouseup:function(a){c.I9(a);c.dG=!1},mouseout:function(a){c.G9(a)},mouseover:function(a){c.Lxa(a)},keydown:function(a){c.QG(a)},ojpanmove:function(a){c.I9(a)}});this.V._on(this.V.element,{focus:function(a){c.Xp(a)},blur:function(a){c.Wp(a)}});a.Oa.er().browser===a.Oa.xk.TO&&this.eg().attr("tabIndex",-1);this.xu===this.xu?this.V._on(this.V.element,{focusin:function(a){c.Xp(a)},focusout:function(a){c.tla(a)}}):this.V._on(this.element,{focus:function(a){c.Xp(a)},
blur:function(a){c.Wp(a)}});this.V.document.bind("touchend.ojlistview touchcancel.ojlistview",this.vB.bind(this));this.Vba();this.V._focusable({applyHighlight:!0,recentPointer:c.X0(),setupHandlers:function(a,b){c.Oy=a;c.qv=b}})},Wz:function(){var a;this.zqa();this.ps();this.m$();a=this.eg();this.xn(a[0]);this.Mb()},refresh:function(){this.qca();this.Rb();this.ZG();this.ps();this.m$();this.Vba();this.Mb()},whenReady:function(){return this.wja},destroy:function(){this.element.removeClass(this.$O()+
" oj-component-initnode");this.hp(this.eg());this.qca();a.D.unwrap(this.element,this.eg());this.V.document.off(".ojlistview")},qca:function(){var a=this;this.q1();this.Yqa(this.element);null!=this.zf&&(this.zf.bh(),delete this.zf,this.zf=null);this.Pt=this.N=null;this.du=[];this.wja=new Promise(function(c){a.xja=c});this.wx()},sKa:function(){this.uO()},$ia:function(){this.eg().removeClass("oj-focus-ancestor");null!=this.N&&g(this.N.elem).removeClass("oj-focus oj-focus-highlight");null!=this.UZ&&this.Sq(this.UZ,
"oj-hover")},XA:function(){this.uO();null!=this.zf&&this.zf.XA()},getNodeBySubId:function(a){var c;if(null==a)return this.element?this.element[0]:null;c=a.subId;if("oj-listview-disclosure"===c||"oj-listview-icon"===c)if(a=a.key,a=this.Ue(a),null!=a&&a.firstElementChild&&(a=a.firstElementChild.firstElementChild,null!=a&&(g(a).hasClass(this.jr())||g(a).hasClass(this.Hn()))))return a;return null},getSubIdByNode:function(a){if(null!=a&&g(a).hasClass(this.jr())||g(a).hasClass(this.Hn()))if(a=this.Hm(a),
null!=a&&0<a.length&&(a=this.yg(a[0]),null!=a))return{subId:"oj-listview-disclosure",key:a};return null},getContextByNode:function(a){var c,d,e;a=this.Hm(a);return null!=a&&0<a.length&&(c=this.yg(a[0]),null!=c)?(d=a.parent(),e=d.children("li").index(a),c={subId:"oj-listview-item",key:c,index:e},d.get(0)!=this.element.get(0)&&(c.parent=d.parent().get(0)),a.children().first().hasClass(this.Sf())?c.group=!0:c.group=!1,c):null},getDataForVisibleItem:function(a){var c;c=a.index;a=a.parent;a=null==a?this.element.get(0):
g(a).children("ul."+this.ti()).first();c=g(a).children("li").get(c);return null!=c&&g(c).hasClass(this.gj())?this.I7(c):null},I7:function(a){return null==this.ce("data")?a:g.data(a,"data")},ps:function(a){null!=this.Xg&&this.Xg.ZFa(a)},hp:function(b){b&&this.Og&&a.D.xm(b,this.Og)},xn:function(b){b&&(null==this.Og&&(this.Og=this.Lg.bind(this)),a.D.$k(b,this.Og))},Lg:function(a,c){0<a&&0<c&&null!=this.zf&&this.zf.Cx(a,c)},Xla:function(){return!0},X0:function(){return function(){return!1}},j1:function(a){return null!=
a.data||null!=a.drillMode||null!=a.groupHeaderPosition||null!=a.item||null!=a.scrollPolicy||null!=a.scrollPolicyOptions},mx:function(a){var c,d,e;if(this.j1(a))return null!=a.data&&(null==a.currentItem&&this.Aj("currentItem",null),null==a.selection&&this.Nk(!0)),!0;if(null!=a.expanded&&this.zf.Yp()&&(this.zo=void 0,d=a.expanded,Array.isArray(d))){this.Rb();this.qra();this.e$=!0;try{c=this,g.each(d,function(a,b){c.sY(b,!0,!0,!0)})}finally{this.e$=void 0,this.Mb()}}null!=a.currentItem?(d=this.Ue(a.currentItem),
null!=d&&(d=g(d),this.Dk(d)||((e=document.activeElement)&&this.element.get(0).contains(e)?this.ns(d,null):this.Fc(d,null)))):null===a.currentItem&&(this.LB(),this.N=null,this.bH());this.dP(a);null!=a.selectionMode&&(this.Nk(!0),this.ZG());null!=a.contextMenu&&this.ps(a.contextMenu);null!=a.scrollTop&&(d=this.Lo(),e=a.scrollTop,null==e||isNaN(e)||(d.scrollTop=e));null!=this.Xg&&null!=this.N&&null!=a.dnd&&null!=a.dnd.reorder&&("enabled"===a.dnd.reorder.items?this.Xg.bda(this.N.elem):"disabled"===a.dnd.reorder.items&&
this.Xg.vFa(this.N.elem));return!1},dP:function(a){var c,d;if(null!=a.selection&&this.yc())for(a.selection=this.Vta(a.selection),c=a.selection,this.Nk(!1),d=0;d<c.length;d++)a=this.Ue(c[d]),null!=a&&this.sC(a,c[d])},Ek:function(a,c,d){return this.V._trigger(a,c,d)},Aj:function(a,c,d){this.V.option(a,c,d)},ce:function(a){return this.V.option(a)},Rb:function(){var a=this;this.du&&(0==this.du.length&&(this.wja=new Promise(function(c){a.xja=c})),this.du.push(1))},Mb:function(){this.du&&0<this.du.length&&
(this.du.pop(),0==this.du.length&&this.xja(null))},aIa:function(a){var c,d=this,e=[];g.each(a,function(a,b){c=d.Ue(b);null!=c&&e.push(c)});return e},m$:function(){var b;this.Rb();b=this.ce("data");if(null!=b){if("undefined"===typeof a.W||"undefined"===typeof a.Iu)throw"oj.TableDataSource or oj.TreeDataSource not found. Ensure the required modules are imported";if(b instanceof a.W)this.zf=new a.Xb(this,this.element[0],b);else if(b instanceof a.Iu)this.zf=new a.Pi(this,this.element[0],b);else throw"Invalid data";
}else this.zf=new a.pe(this,this.element[0]);this.hB();this.zf.Y0();this.Mb()},dma:function(a){this.element.attr("aria-activedescendant",a.attr("id"))},ZG:function(){this.element.attr("aria-activedescendant","");this.tn()?this.element.attr("aria-multiselectable",!0):this.yc()&&this.element.attr("aria-multiselectable",!1)},q1:function(){this.element.removeAttr("aria-activedescendant").removeAttr("aria-multiselectable")},zqa:function(){var a,c;a=this.eg();this.ZG();c=this.Cqa();a.append(c);this.tm=
c;c=this.tqa();a.append(c);this.FA=c;this.Vl()&&null!=this.Xg&&a.append(this.uqa())},Cqa:function(){var a=g(document.createElement("div"));a.addClass("oj-listview-status-message oj-listview-status").attr({id:this.kv("status"),role:"status"});return a},tqa:function(){var a=g(document.createElement("div"));a.addClass("oj-helper-hidden-accessible").attr({id:this.kv("info"),role:"status"});return a},uqa:function(){var a=g(document.createElement("div"));a.addClass("oj-helper-hidden-accessible").attr({id:this.kv("instr")});
a.text(this.V.F("accessibleReorderTouchInstructionText"));return a},Qg:function(a){""!=a&&this.FA.text()!=a&&this.FA.text(a)},hB:function(){var a=this.V.F("msgFetchingData");this.tm.text(a).css("left",this.element.outerWidth()/2-this.tm.outerWidth()/2).show()},or:function(){this.tm.hide()},hk:function(){return this.eg()},eg:function(){null==this.PF&&(this.PF=this.asa());return this.PF},asa:function(){var a;this.oe?a=g(this.oe):(a=g(document.createElement("div")),this.element.parent()[0].replaceChild(a[0],
this.element[0]));a.addClass(this.t0()).addClass("oj-component");a.prepend(this.element);return a},O7:function(){return this.V.F("msgNoData")},yC:function(){var a,c;a=this.O7();c=document.createElement("li");c.id=this.kv("empty");c.className="oj-listview-no-data-message oj-listview-empty-text";c.textContent=a;return c},fh:function(a){a=this.mg(a).attr("aria-expanded");return"true"==a?this.Lm:"false"==a?this.Km:this.$0},Hu:function(a,c){var d=this.DA();c==this.Lm?(this.mg(a).attr("aria-expanded","true"),
d&&a.removeClass("oj-collapsed").addClass("oj-expanded")):c==this.Km&&(this.mg(a).attr("aria-expanded","false"),d&&a.removeClass("oj-expanded").addClass("oj-collapsed"))},qD:function(a,c,d){a=this.options.item[a];return"function"==typeof a&&d?a.call(this,c):a},fva:function(){var a=this.qD("renderer",null,!1);return"function"!=typeof a?null:a},Yha:function(){},zZ:function(a){var c;null!=this.N&&this.N.elem&&g(this.N.elem).get(0)==a&&this.Aj("currentItem",null);if(null!=a&&a.id&&null!=this.Jp)for(c in this.Jp)if(this.Jp.hasOwnProperty(c)&&
this.Jp[c]===a.id){delete this.Jp[c];break}},Qw:function(a,c){var d,e,f,h;null!=this.Xg&&this.Xg.Qw(a);this.SC(a);if(this.yc())if(d=this.ce("selection"),this.yk(a))for(f=0;f<d.length;f++){if(d[f]==c.key&&(this.sC(a,d[f]),!this.tn())){1<d.length&&(e=g(this.Ue(c.key)),this.Aj("selection",[c.key],{_context:{originalEvent:null,kb:!0,bl:{items:e}},changed:!0}));break}}else if(f=d.indexOf(c.key),-1<f){d=d.slice(0);d.splice(f,1);e=Array(d.length);for(f=0;f<d.length;f++)e[f]=this.Ue(d[f]);this.Aj("selection",
d,{_context:{originalEvent:null,kb:!0,bl:{items:g(e)}},changed:!0})}this.zf.Yp()&&void 0==this.e$&&this.fh(g(a))==this.Km&&(f=this.ce("expanded"),this.jz()?void 0==this.zo&&this.wu(g(a),null,!1,null,!1,!1,!1):Array.isArray(f)&&(h=this,g.each(f,function(d,e){e!=c.key||void 0!=h.zo&&-1!=h.zo.indexOf(e)||h.wu(g(a),null,!1,null,!1,!1,!1)})));null!=this.N&&c.key==this.N.key&&null!=this.N.elem&&a!=this.N.elem.get(0)&&(this.N.elem=g(a))},eu:function(){var a;this.or();g(document.getElementById(this.kv("empty"))).remove();
0==this.element[0].childElementCount?(a=this.yC(),this.element.append(a)):(this.OA=null,a=this.ce("currentItem"),null!=a&&(a=this.Ue(a),null==a?this.Aj("currentItem",null):null!=this.N||this.Dk(g(a))||this.ns(g(a),null)),this.eg().hasClass("oj-focus-ancestor")&&null==this.N&&this.r$(),this.uO());this.Ek("ready",null,{})},uO:function(){var a,c;a=this.ce("scrollTop");if(!isNaN(a)&&(c=this.Lo(),a!=c.scrollTop&&(c.scrollTop=a,c.scrollTop!=a))){this.UW=!0;return}this.UW=!1},jLa:function(){var a=this.ce("currentItem");
null!=a&&(a=this.Ue(a),null==a||this.Dk(g(a))||this.ns(g(a),null))},wx:function(){this.SZ=this.OA=null},Zia:function(a,c,d){if(this.UG(g(c.target)))return!1;a=g(c.target).closest("."+this.Ug());0<a.length&&!this.Dk(g(a[0]))&&this.ns(g(a[0]),null);a=this.element;null!=this.N&&(a=this.N.elem);a={launcher:a,initialFocus:"menu"};"keyboard"===d&&(a.position={my:"start top",at:"start bottom",of:this.N.elem});this.V.qh(c,d,a)},B0:function(a){return null!=a.prop("nodeName").match(/^INPUT|SELECT|OPTION|BUTTON|^A\b|TEXTAREA/)},
UG:function(a){for(;null!=a&&a[0]!=this.element[0]&&"LI"!=a.prop("nodeName");){if(3!=a[0].nodeType){var c=a.attr("tabIndex"),d=a.attr("data-oj-tabindex");if(null!=c&&0<=c&&!a.hasClass(this.vp())||this.B0(a)&&(-1!=c||-1!=d))return!0}a=a.parent()}return!1},SC:function(a){var c;a=g(a);a.hasClass(this.gj())||(a=g(a.get(0).firstElementChild));a.find("a, input, select, textarea, button, object, .oj-component-initnode").each(function(){g(this).removeAttr("data-first").removeAttr("data-last");c=parseInt(g(this).attr("tabIndex"),
10);(isNaN(c)||0<=c)&&g(this).attr("tabIndex",-1).attr("data-tabmod",isNaN(c)?-1:c)})},Tsa:function(a){var c,d;c=this.xv();a=c.index(a);for(d=0;d<=a;d++)this.SC(c[d])},Ssa:function(a){var c;c=this.xv();a=c.index(a);if(-1!=a)for(;a<=c.length-1;a++)this.SC(c[a])},zta:function(a){var c;a=g(a).find("[data-tabmod]").each(function(){c=parseInt(g(this).attr("data-tabmod"),10);g(this).removeAttr("data-tabmod");-1==c?g(this).removeAttr("tabIndex"):g(this).attr("tabIndex",c)});a.first().attr("data-first","true");
a.last().attr("data-last","true")},Yqa:function(a){g(a).find("[data-tabmod]").removeAttr("tabIndex").removeAttr("data-tabmod").removeAttr("data-first").removeAttr("data-last")},Dk:function(a){return a.hasClass("oj-skipfocus")},gV:function(a){return void 0===a.relatedTarget||null!=a.relatedTarget&&g.contains(this.V.element.get(0),a.relatedTarget)?!0:!1},Xp:function(a){this.eg().addClass("oj-focus-ancestor");null==this.N?this.dG||this.gV(a)||this.r$(a):(this.dG||this.U$()||this.gV(a)||this.wB(),this.pP(),
this.KW(this.N.elem))},r$:function(a){var c,d,e;if(!this.Vl())for(c=this.xv(),d=0;d<c.length;d++)if(e=g(c[d]),!this.Dk(e)){this.ns(e,a);break}},tla:function(a){this.Wp(a)},REa:function(){var b=a.Oa.er();return b.browser==a.Oa.xk.TO&&48>parseInt(b.browserVersion,10)?!1:!0},sza:function(b){var c=a.Oa.er();return null==b.relatedTarget&&c.browser==a.Oa.xk.SG&&b.target==this.V.element.get(0)?!0:!1},Wp:function(a){!this.REa()||this.sza(a)||this.gV(a)||(this.eg().removeClass("oj-focus-ancestor"),this.LB(),
null!=this.N&&this.tca(this.N.elem),this.bH())},G9:function(a){a=this.Hm(a.target);null!=a&&(this.UZ=null,this.Sq(a,"oj-hover"))},Lxa:function(a){this.uE()||(a=this.Hm(a.target),null==a||this.Dk(a)||(this.UZ=a,this.nK(a,"oj-hover")))},uE:function(){return 500>Date.now()-this.tV},QG:function(a){var c,d;if(this.DA()&&(c=a.keyCode,c===this.Bg||c===this.kh))if(d=this.N.elem,c===this.Bg){if(this.fh(d)==this.Lm){this.Qr(d,a,!0,this.N.key,!0,!0);return}}else if(this.fh(d)==this.Km){this.wu(d,a,!0,this.N.key,
!0,!0,!0);return}c=this.z0(a);null!=this.Xg&&(c=c||this.Xg.QG(a));!0===c&&a.preventDefault()},I9:function(a){this.Yw&&this.Sq(this.Yw,"oj-focus");null!=this.Xg&&this.Xg.wea(g(a.target))},RG:function(a){var c,d;d=g(a.target);null!=this.Xg&&this.Xg.Zca(d);c=this.Hg(d,!0);null!=c&&this.G$(c)&&(this.dG=!0,c=null);null==c||0==c.length||this.Dk(c)||d.hasClass("oj-listview-drag-handle")||(this.dG=!0,this.eg().hasClass("oj-focus-ancestor")||this.eg().addClass("oj-focus-ancestor"),this.Yw=c,this.nK(c,"oj-focus"),
a.originalEvent.touches&&0<a.originalEvent.touches.length&&(this.SN={x:a.originalEvent.changedTouches[0].pageX,y:a.originalEvent.changedTouches[0].pageY}))},vB:function(b){var c,d;null!=this.Yw&&(this.Sq(this.Yw,"oj-focus"),null!=this.SN&&(c=this.Yw.offset(),d=this.Hw("pointerUp"),d.offsetX=this.SN.x-c.left+"px",d.offsetY=this.SN.y-c.top+"px",c=this.Yw.children("."+this.Sf()),c=0<c.length?c.get(0):this.Yw.get(0),a.$.ym(c,"pointerUp",d),this.SN=null));this.tV=Date.now();this.G9(b)},ZI:function(){var a;
a=this.N.elem;this.SC(a);this.zta(a);0<a.find("[data-first]").length&&this.Sca(!0)},Gs:function(){this.Sca(!1);this.SC(this.N.elem)},cP:function(a){var c,d,e,f;0===a.button&&(c=this.Hn(),d=this.jr(),e=this.Sf(),f=g(a.target),f.hasClass(d)?(this.yo(a),a.preventDefault()):f.hasClass(c)?(this.cg(a),a.preventDefault()):(c=this.Hg(f),null==c||0==c.length||this.Dk(c)||(this.F$()&&null!=this.N&&this.N.elem.get(0)!=c.get(0)&&this.Gs(),this.eg().hasClass("oj-focus-ancestor")||this.eg().addClass("oj-focus-ancestor"),
this.yc()&&this.yk(c[0])?this.Vl()?this.kya(c,a):this.sla(c,a):this.PG(c,a),this.DA()&&f.closest("."+e)&&(this.fh(c)==this.Km?this.cg(a):this.fh(c)==this.Lm&&this.yo(a)))))},Vl:function(){return a.D.jf()},U$:function(){return this.Vl()&&a.Oa.er().os!=a.Oa.yl.x1},oS:function(b){return a.D.qr(b)},kv:function(a){return[this.element.attr("id"),a].join(":")},Hm:function(a){return g(a).closest("."+this.Ug())},G$:function(a){return a.hasClass("oj-clickthrough-disabled")||a.hasClass("oj-component-initnode")||
a.hasClass("oj-component")},Hg:function(a,c){for(var d=a;0<d.length;){if(this.G$(d)){if(c)return d;break}if(d.hasClass(this.Ug()))return d;d=d.parent()}return null},lva:function(){null==this.hia&&(this.hia=parseInt(this.eg().css("border-top-width"),10)+parseInt(this.eg().css("border-bottom-width"),10));return this.hia},Mca:function(a){var c,d,e,f,h,k,l=0;c=a.offsetTop;d=a.offsetHeight;a=this.eg()[0];e=a.scrollTop;f=a.offsetHeight;null!=this.Yg&&(h=parseInt(this.Yg.style.top,10),k=g(this.Yg).outerHeight(),
c<=h&&h<c+d?l=(d+c-h)/2:c>=h&&c<h+k&&(l=(h+k-c)/2));c>=e&&c+d<=e+f?0<l&&(a.scrollTop=e-l):(c=Math.max(0,Math.min(c-l,Math.abs(c+d-f))),c>e&&(c+=this.lva()),a.scrollTop=c)},yg:function(a){return this.zf.yg(a)},Ue:function(a){var c;return null!=this.Jp&&(c=this.Jp[a],null!=c)?document.getElementById(c):this.zf.Ue(a)},Dx:function(a){return a==this.Bl||a==this.sl},xv:function(){var a,c,d;null==this.OA&&(a=this.Iw(),c="."+this.Ug()+":visible",this.OA=this.element.find(c).filter(function(){return(d=g(this).parent().hasClass(a))?
!g(this).parent().parent().hasClass("oj-collapsed"):!0}));return this.OA},xxa:function(a){a=a.get(0).nextElementSibling;null!=a&&g(a).hasClass(this.Ug())||(a=this.Lo(),a.scrollTop<a.scrollHeight&&(a.scrollTop=a.scrollHeight))},Bu:function(a,c,d){var e,f,h;if(!this.zf.Ex())return!0;e=!c||this.HN?this.N.elem:this.$d;f=!1;h=this.xv();e=h.index(e);switch(a){case this.Bl:e--;if(0<=e){for(a=g(h[e]);this.Dk(a);){e--;if(0>e)return!1;a=g(h[e])}c?(this.OS(a,d),this.HN=!1):(this.ns(a,d),this.HN=!0)}f=!0;break;
case this.sl:e++;if(e<h.length){for(a=g(h[e]);this.Dk(a);){e++;if(e==h.length)return!1;a=g(h[e])}c?(this.OS(a,d),this.HN=!1):(this.ns(a,d),this.HN=!0,this.xxa(a))}f=!0}return f},F$:function(){return"actionable"==this.Aia},Sca:function(a){this.Aia=a?"actionable":"navigation";a||this.element[0].focus()},lMa:function(){return this.xu},mg:function(a){return a.hasClass(this.vp())?a:g(a.find("."+this.vp()).first())},bH:function(){this.element.attr("tabIndex",0)},pP:function(){this.element.removeAttr("tabIndex")},
KW:function(a){this.mg(a).attr("tabIndex",0)},tca:function(a){var c;c=!0;"presentation"===a.attr("role")&&(c=!1);a=this.mg(a);c?a.removeAttr("tabIndex"):a.attr("tabIndex",-1)},n7:function(a,c){this.xu===this.xu?(null!=a&&this.tca(a),this.KW(c),this.pP()):this.dma(c)},TM:function(a){var c;c=a.children("a, input, select, textarea, button");return 1===c.length&&0===c.first().find("a, input, select, textarea, button").length?c.first():a},Fc:function(a,c){var d,e,f;null!=a?(d=a[0],d=this.yg(d),null==this.N||
d!=this.N.key?(e={key:d,item:a},null!=this.N&&(e.previousKey=this.N.key,e.previousItem=this.N.elem,null!=this.Xg&&this.Vl()&&this.Xg.wea(e.previousItem)),f=!this.Ek("beforeCurrentItem",c,e),f||(this.N=f={key:d,elem:a},null!=this.Xg&&this.Vl()&&this.Xg.Zca(a),this.n7(e.previousItem,a),this.Aj("currentItem",d,{_context:{originalEvent:c,kb:!0,bl:{item:a}},changed:!0}))):d==this.N.key&&(this.N=f={key:d,elem:a},this.n7(null,a))):this.N=null},wB:function(a){var c,d;null!=this.N&&this.eg().hasClass("oj-focus-ancestor")&&
(a=a||!1,c=this.N.elem,this.nK(c,"oj-focus"),this.xu===this.xu&&(c=this.mg(c),d=document.activeElement,!a&&c.get(0).contains(d)||c.get(0).focus()))},LB:function(){null!=this.N&&this.Sq(this.N.elem,"oj-focus")},PG:function(a,c){this.ns(a,c)},ns:function(a,c){this.Mca(a[0]);this.LB();this.Fc(a,c);this.wB()},yc:function(){return"none"!=this.ce("selectionMode")},tn:function(){return"multiple"==this.ce("selectionMode")},yk:function(a){a=this.mg(g(a)).get(0);return a.hasAttribute("aria-selected")},Vta:function(a){var c,
d,e;c=[];for(d=0;d<a.length&&(e=this.Ue(a[d]),null==e||!this.yk(e)||(c.push(a[d]),this.tn()));d++);return c},sFa:function(){var a,c;null!=this.Jp&&(a=this,g.each(this.ce("selection"),function(d,e){c=a.Ue(e);null!=c&&a.Sq(c,"oj-selected")}))},nK:function(a,c){this.xB(a,c,!0)},Sq:function(a,c){this.xB(a,c,!1)},xB:function(a,c,d){var e;a=g(a);"oj-selected"==c&&this.mg(a).attr("aria-selected",d?"true":"false");e=a.children("."+this.Sf());0<e.length&&(a=g(e[0]));"oj-focus"===c?d?"actionable"!=this.Aia&&
this.Oy(a):this.qv(a):d?a.addClass(c):a.removeClass(c)},sla:function(a,c){var d,e;this.Mca(a[0]);d=this.oS(c);e=c.shiftKey;this.tn()?d||e?!d&&e?this.OS(a,c):this.lR(a,c):this.GB(a,c):this.GB(a,c)},kya:function(a,c){this.tn()?this.lR(a,c):this.GB(a,c)},Nk:function(a){this.sFa();a&&this.Aj("selection",[],{_context:{originalEvent:null,kb:!0,bl:{items:g()}},changed:!0});this.$d=null},GB:function(a,c){this.Nk(!1);this.lR(a,c,[])},OS:function(a,c){var d;null!=this.N&&(d=this.$d,d!=a&&(this.Sq(a,"oj-focus"),
this.R6(this.N.elem,a,c)))},R6:function(a,c,d){this.Nk(!1);this.$d=c;this.yya(a,c,d);this.wB()},yya:function(a,c,d){var e,f,h,k,l;e=[];f=[];h=this.xv();a=h.index(a);k=h.index(c);a>k?c=k:(c=a,a=k);for(;c<=a;c++)k=h[c],this.yk(k)&&(l=this.zf.yg(k),this.sC(k,l),e.push(l),f.push(k));this.Aj("selection",e,{_context:{originalEvent:d,kb:!0,bl:{items:g(f)}},changed:!0})},sC:function(a,c){null==this.Jp&&(this.Jp={});this.Jp[c]=g(a).attr("id");this.nK(a,"oj-selected")},lR:function(a,c,d){var e,f;e=this.yg(a[0]);
void 0==d&&(d=this.ce("selection").slice(0));this.LB();this.Fc(a,c);this.wB();if(null==this.N||this.N.elem.get(0)!=a.get(0))null!=d&&0==d.length&&this.Aj("selection",d,{_context:{originalEvent:c,kb:!0,bl:{items:g([])}},changed:!0});else{f=d.indexOf(e);-1<f?(this.Sq(a,"oj-selected"),d.splice(f,1)):(this.$d=a,this.sC(a,e),d.push(e));a=Array(d.length);for(e=0;e<d.length;e++)a[e]=this.Ue(d[e]);this.Aj("selection",d,{_context:{originalEvent:c,kb:!0,bl:{items:g(a)}},changed:!0})}},dH:function(a,c,d){var e,
f,h,k;e=this.ce("selection").slice(0);f=this.N.elem;h=this.N.key;k=e.indexOf(h);if(-1<k){if(d)return;this.Sq(f,"oj-selected");e.splice(k,1);0==e.length&&(this.$d=null)}else this.yk(f[0])&&(c||(this.Nk(!1),e.length=0),this.$d=f,this.sC(f,h),e.push(h));c=Array(e.length);for(d=0;d<e.length;d++)c[d]=this.Ue(e[d]);this.Aj("selection",e,{_context:{originalEvent:a,kb:!0,bl:{items:g(c)}},changed:!0})},z0:function(a){var c,d,e,f=!1;if(null==this.N)return!1;c=a.keyCode;d=this.N.elem;this.F$()?c==this.RO?(this.Gs(),
this.wB(!0),this.KW(d),f=!0):c===this.cH&&(c=d.find("[data-first]"),d=d.find("[data-last]"),a.shiftKey?0<c.length&&0<d.length&&c!=d&&a.target==c[0]&&(d[0].focus(),f=!0):0<c.length&&0<d.length&&c!=d&&a.target==d[0]&&(c[0].focus(),f=!0)):c==this.SO?(this.ZI(),c=d.find("[data-first]"),0<c.length&&(c[0].focus(),d.removeClass("oj-focus-highlight"))):c==this.sP&&this.yc()?(d=this.oS(a),(e=a.shiftKey)&&!d&&null!=this.$d&&this.tn()?this.R6(this.$d,this.N.elem,a):this.dH(a,d&&!e&&this.tn(),!1),f=!0):c==this.PO&&
this.yc()?this.dH(a,!1,!0):this.Dx(c)?(d=this.oS(a),e=a.shiftKey,d||(f=this.Bu(c,e&&this.yc()&&this.tn(),a))):c===this.cH&&(a.shiftKey?this.Tsa(d):this.Ssa(d));return f},K$:function(a){return a&&this.Pt?-1<this.Pt.indexOf(a):!1},qL:function(a,c){var d;if(null!=a)if(null==this.Pt&&(this.Pt=[]),c)this.Pt.push(a);else for(d=this.Pt.indexOf(a);-1<d;)this.Pt.splice(d,1),d=this.Pt.indexOf(a)},Hw:function(b){var c;null==this.Gfa&&(c=a.Wc.De(this.Ega()),this.Gfa=c.animation);return this.Gfa[b]},DA:function(){return"none"!=
this.ce("drillMode")},jz:function(){var a=this.ce("expanded");if("auto"===a){if(!this.DA())return!0}else if("all"===a)return!0;return!1},sY:function(a,c,d,e,f){var h=this.Ue(a);null!=h&&this.wu(g(h),null,f,a,c,e,d)},cg:function(a){var c=this.Hm(a.target);null!=c&&0<c.length&&this.wu(c,a,!0,null,!0,!0,!0)},wu:function(a,c,d,e,f,g,k){var l;if(this.fh(a)==this.Km&&(null==e&&(e=this.yg(a[0])),!d||!this.K$(e))){l={item:a,key:e};if(k&&(k=!this.Ek("beforeExpand",c,l))&&f)return;this.Rb();d&&this.qL(e,!0);
this.zf.Ax(a,function(a){this.Jta(a,d,c,l,g)}.bind(this));this.OA=null;null!=c&&c.stopPropagation();null!=this.zo&&(a=this.zo.indexOf(e),-1!=a&&this.zo.splice(a,1));this.Mb()}},Jta:function(a,c,d,e,f){var h,k,l=this;this.Rb();a.key=e.key;c=this.JO(g(a),c,d);a=a.parentNode;a=g(a);this.Hu(a,this.Lm);h=this.Hn();k=this.jr();a.children("."+this.Sf()).find("."+h).removeClass(h).addClass(k);f&&c.then(function(){l.Ek("expand",d,e)});c.then(function(){l.Mb()})},f4:function(a,c){var d;a.parentsUntil("ul.oj-component-initnode",
"ul."+this.ti()).each(function(){d=parseInt(g(this).css("maxHeight"),10);0<d&&g(this).css("maxHeight",d+c+"px")})},JO:function(b,c){var d=0,e,f,h=this,k,l;e=new Promise(function(a){f=a});c?(this.Rb(),b.children().each(function(){d+=g(this).outerHeight(!0)}),this.Vl()&&this.f4(b,d),b.css("maxHeight",d+"px"),k=this.Hw("expand"),this.Rb(),l=b.get(0),k=a.$.ym(l,"expand",k),k.then(function(){h.Pwa(b,f)}),this.Mb()):(this.Vl()?(b.children().each(function(){d+=g(this).outerHeight(!0)}),b.css("maxHeight",
d+"px"),this.f4(b,d)):b.css("maxHeight",""),this.KO(b),f(null));return e},Pwa:function(a,c){this.Vl()||a.css("maxHeight","");this.KO(a);c(null);this.Mb()},KO:function(a){a.removeClass(this.Iw()).addClass(this.lA());this.qL(a[0].key,!1)},kfa:function(a,c,d,e){var f=this.Ue(a);null!=f&&this.Qr(g(f),null,e,a,c,d)},yo:function(a){var c=this.Hm(a.target);null!=c&&0<c.length&&this.Qr(c,a,!0,null,!0,!0)},Qr:function(a,c,d,e,f,g){var k,l,m=this;this.fh(a)==this.Lm&&(null==e&&(e=this.yg(a[0])),d&&this.K$(e)||
(k={item:a,key:e},l=!this.Ek("beforeCollapse",c,k),l&&f||(this.Rb(),d&&this.qL(e,!0),l=this.HO(a,e,d,c),this.Hu(a,this.Km),d=this.Hn(),f=this.jr(),a.find("."+f).first().removeClass(f).addClass(d),this.OA=null,null!=c&&c.stopPropagation(),g&&l.then(function(){m.Ek("collapse",c,k)}),void 0==this.zo&&(this.zo=[]),-1==this.zo.indexOf(e)&&this.zo.push(e),l.then(function(){m.Mb()}))))},HO:function(b,c,d){var e=0,f,h,k,l=this;h=new Promise(function(a){k=a});f=b.children("ul").first();f[0].key=c;d?(this.Rb(),
f.children().each(function(){e+=g(this).outerHeight()}),f.css("maxHeight",e+"px"),b=this.Hw("collapse"),b.persist="all",this.Rb(),c=f.get(0),b=a.$.ym(c,"collapse",b),b.then(function(){l.vwa(f,k)}),this.Mb()):(f.css("maxHeight","0px"),this.IO(f),k(null));return h},vwa:function(a,c){this.IO(a);c(null);this.Mb()},IO:function(a){a.removeClass(this.lA()).addClass(this.Iw());null!=this.zf&&this.zf.xx(a);this.qL(a[0].key,!1)},qra:function(){var a;this.Rb();a=this;this.xv().each(function(){a.Qr(g(this),null,
!1,null,!1,!1)});this.Mb()},getExpanded:function(){var a,c,d;a=[];c=this;this.xv().each(function(){d=g(this);c.fh(d)==c.Lm&&a.push(c.yg(d[0]))});return a},Yc:function(){return a.Components.Yc(this.element)},t0:function(){return this.U$()?"oj-listview oj-listview-container-touch":"oj-listview oj-listview-container"},$O:function(){return"oj-listview-element"},gj:function(){return"oj-listview-item"},vp:function(){return"oj-listview-focused-element"},Ug:function(){return"oj-listview-item-element"},Sf:function(){return"oj-listview-group-item"},
ti:function(){return"oj-listview-group"},lA:function(){return"oj-listview-collapsible-transition"},Iw:function(){return this.lA()},Hn:function(){return"oj-listview-collapse-icon"},jr:function(){return"oj-listview-expand-icon"},ONa:function(){return"oj-listview-no-data-message"},LY:function(){return""},Ega:function(){return"oj-listview-option-defaults"},vBa:function(a,c){var d=c.originalEvent.wheelDelta;isNaN(d)||(0>d?a.scrollTop+a.clientHeight+Math.abs(d)>=a.scrollHeight&&(a.scrollTop=a.scrollHeight,
c.preventDefault()):0>=a.scrollTop-d&&(a.scrollTop=0,c.preventDefault()))},QJ:function(){var a=this.Lo();return a==document.body||a==document.documentElement?window:a},Vba:function(){var a=this,c;c=g(this.QJ());this.V._off(c,"scroll mousewheel");this.V._on(c,{scroll:function(c){a.UW||a.Aj("scrollTop",a.Lo().scrollTop,{_context:{originalEvent:c,kb:!0}});a.UW=!1;a.Y$()&&a.L9()}});"loadMoreOnScroll"==this.options.scrollPolicy&&this.V._on(c,{mousewheel:function(c){a.vBa(a.Lo(),c)}})},Y$:function(){return"static"!=
this.ce("groupHeaderPosition")},nD:function(){var a;null==this.SZ&&(a="."+this.Sf()+":visible",this.SZ=this.element.find(a).filter(function(){return!g(this).parent().hasClass("oj-collapsed")&&0<g(this).next().children().length?!0:!1}));return this.SZ},BX:function(a){g(a).removeClass("oj-pinned");a.style.top="auto";a.style.width="auto"},w8:function(a){var c;c=this.nD();a=c.index(a);return-1<a&&a<c.length-1?c[a+1]:null},iBa:function(a,c){var d,e,f;d=a.offsetWidth;e=a.offsetHeight;f=this.w8(a);null!=
f&&f.offsetTop<=c+e+5&&(c-=e);g(a).addClass("oj-pinned");a.style.top=c+"px";a.style.width=d+"px"},L9:function(){var a,c,d,e,f,g,k,l;a=this.Lo().scrollTop;if(null!=this.Yg&&0==a)this.BX(this.Yg),this.Yg=null;else{d=this.nD();e=0;null!=this.Yg&&(e=this.Yg.offsetHeight);for(f=0;f<d.length;f++)if(g=d[f],this.Yg!=g&&(k=d[f].offsetTop,l=k+g.parentNode.offsetHeight,k<a&&l>a+e)){c=g;break}null!=c&&c!=this.Yg?(null!=this.Yg&&this.BX(this.Yg),this.iBa(c,a),this.Yg=c):null!=this.Yg&&(c=this.w8(this.Yg),this.Yg.style.top=
null!=c&&c.offsetTop<=a+e?c.offsetTop-e+"px":a+"px")}},Lo:function(){var a;a=this.ce("scrollPolicyOptions");return null!=a&&(a=a.scroller,null!=a)?a:this.eg().get(0)},Lca:function(a){var c,d;c=this.Lo();d=c.scrollTop;null!=this.Yg&&(this.BX(this.Yg),this.Yg=null);c.scrollTop=a.offsetTop;this.Y$()&&d==c.scrollTop&&this.L9();this.MDa(a)},MDa:function(a){var c=this,d;g(a).next().children().each(function(){d=g(this);if(!c.Dk(d))return c.Aj("currentItem",this.key),!1})}});o_("_ojListView",a.JV,a);a.Ra("oj.ojListView",
g.oj.baseComponent,{widgetEventPrefix:"oj",options:{currentItem:null,data:null,dnd:{drag:null,drop:null,reorder:{items:"disabled"}},drillMode:"collapsible",expanded:"auto",groupHeaderPosition:"sticky",item:{focusable:!0,renderer:null,selectable:!0},scrollPolicy:"auto",scrollPolicyOptions:{fetchSize:25,maxCount:500},scrollTop:0,selection:[],selectionMode:"none",animateStart:null,animateEnd:null,beforeCurrentItem:null,beforeExpand:null,beforeCollapse:null,collapse:null,copy:null,cut:null,expand:null,
optionChange:null,paste:null,ready:null,reorder:null},_ComponentCreate:function(){this._super();this.ab()},ab:function(){var b={};b.element=this.element;b.oe=this.oe;b.V=this;b=g.extend(this.options,b);this.Da=new a.JV;this.Da.pr(b)},Nh:function(){this._super();this.Da.Wz()},_destroy:function(){this.Da.destroy();this._super()},ph:function(a,c,d){this.Da.Zia(a,c,d)},_setOptions:function(a,c){var d=this.Da.mx(a,c);this._super(a,c);d&&(this.Da.refresh(),this.g7())},_setOption:function(a,c,d){var e=!0;
"selectionMode"==a?e="none"==c||"single"==c||"multiple"==c:"drillMode"==a?e="collapsible"==c||"none"==c:"scrollPolicy"==a?e="auto"==c||"loadMoreOnScroll"==c:"groupHeaderPosition"==a&&(e="static"==c||"sticky"==c);if(e)"selection"==a&&(d={_context:{bl:{items:g(this.Da.aIa(c))}}}),this._super(a,c,d);else throw"Invalid value: "+c+" for key: "+a;},gq:function(){this.Da.sKa()},Gj:function(){this.Da.$ia()},hq:function(){this.Da.XA()},widget:function(){return this.Da.hk()},refresh:function(){this._super();
this.Da.refresh();this.g7()},whenReady:function(){return this.Da.whenReady()},getNodeBySubId:function(a){return this.Da.getNodeBySubId(a)},getSubIdByNode:function(a){return this.Da.getSubIdByNode(a)},getContextByNode:function(a){return this.Da.getContextByNode(a)},getDataForVisibleItem:function(a){return this.Da.getDataForVisibleItem(a)},expand:function(a,c){this.Da.sY(a,c,!0,!0)},collapse:function(a,c){this.Da.kfa(a,c,!0)},getExpanded:function(){return this.Da.getExpanded()},getIndexerModel:function(){null==
this.DF&&a.Oi&&(this.DF=new a.Oi(this.Da));return this.DF},g7:function(){null!=this.DF&&this.DF.Tfa&&this.DF.Tfa()}});a.Components.Xa("ojListView","baseComponent",{properties:{currentItem:{type:"Object"},data:{},dnd:{},drillMode:{type:"string"},expanded:{type:"Array\x3cObject\x3e|string"},groupHeaderPosition:{},item:{},scrollPolicy:{type:"string"},scrollPolicyOptions:{type:"Object\x3cstring, number\x3e"},scrollTop:{type:"number"},selection:{type:"Array\x3cObject\x3e"},selectionMode:{type:"string"}},
methods:{collapse:{},expand:{},getContextByNode:{},getDataForVisibleItem:{},getExpanded:{},getIndexerModel:{},getNodeBySubId:{},getSubIdByNode:{},refresh:{},whenReady:{},widget:{}},extension:{_hasWrapper:!0,_innerElement:"ul",_widgetName:"ojListView"}});a.Components.register("oj-list-view",a.Components.getMetadata("ojListView"))});